//
//  XWXWaterfallFlowLayout.h
//  XWXWaterfallFlow
//
//  Created by 许卫星 on 16/12/14.
//  Copyright © 2016年 许卫星. All rights reserved.
//

#import <UIKit/UIKit.h>
@class XWXWaterfallFlowLayout;

@protocol XWXWaterfallFlowLayoutDelegate <NSObject>
@required

/**
 根据宽度计算高度
 @param flowLayout XWXWaterfallFlowLayout
 @param indexPatch itemIndexPatch
 @param itemW      itemW

 @return itemH
 */
- (CGFloat)waterfallFlowLayout:(XWXWaterfallFlowLayout *)flowLayout itemIndexPatch:(NSIndexPath *)indexPatch itemW:(CGFloat)itemW;

@optional

/**
 设置瀑布流列数
 @param waterflowLayout XWXWaterfallFlowLayout
 @return 瀑布流列数
 */
- (CGFloat)columnCountInWaterflowLayout:(XWXWaterfallFlowLayout *)waterflowLayout;

/**
 设置瀑布流每列水平间隔
 @param waterflowLayout XWXWaterfallFlowLayout
 @return 瀑布流每列间隔
 */
- (CGFloat)columnMarginInWaterflowLayout:(XWXWaterfallFlowLayout *)waterflowLayout;


/**
 设置瀑布流垂直间隔
 @param waterflowLayout XWXWaterfallFlowLayout
 @return 瀑布流垂直间隔
 */
- (CGFloat)rowMarginInWaterflowLayout:(XWXWaterfallFlowLayout *)waterflowLayout;

/**
 设置瀑布流边框间距
 @param waterflowLayout XWXWaterfallFlowLayout
 @return 瀑布流边框间距
 */
- (UIEdgeInsets)edgeInsetsInWaterflowLayout:(XWXWaterfallFlowLayout *)waterflowLayout;

@end

@interface XWXWaterfallFlowLayout : UICollectionViewLayout


@property (nonatomic, weak) id<XWXWaterfallFlowLayoutDelegate> delegate;
@end
